/*
 * This is a Standard Issue Point Class
 * There's no need for Set commands since every click creates a new point and cant change it.
 * 
 */

package Points;

import java.awt.Color;



/**
 *
 * @author  Avishai Kopeliansky 
 */
public class Point  {
 int _x , _y;
 int r,g,b;
 Color c;
 /**
  *Default constructor
  */
 public Point(){
     this._x=0;
     this._y=0;
      r=255;
      g=255;
      b=255;
 }

 /**
  *Constructor by value
  * @param x cord value
  * @param y cord value
  * @param m the Color given
  */
 public Point(int x , int y , Color m){

     this._x = x;
     this._y = y;
     this.r = m.getRed();
     this.g = m.getGreen();
     this.b = m.getBlue();
 }

 /**
  *Copy Constructor
  * 
  * @param p Point for copying
  */
 public Point( Point p){
     this._x = p._x;
     this._y = p._y;
     this.r = p.r;
     this.g = p.g;
     this.b = p.b;
 }

 /**
  *Returns the Value of X and Y for Writing and Reading from file mainly.
  * 
  * @return this._x
  */
 public int GetX(){
     return this._x;
 }
 /**
  *Returns the Value of X and Y for Writing and Reading from file mainly.
  * @return this._y
  */
 public int GetY(){
     return this._y;
 }
 /**
  *Returns the Value of The color Red in RGB Method.
  * @return this.r
  */
public int getRed(){
    return this.r;
}
 /**
  *Returns the Value of The color Green in RGB Method..
  * @return this.g
  */
public int getGreen(){
    return this.g;
}
 /**
  *Returns the Value of The color Blue in RGB Method..
  * @return this.b
  */
public int getBlue(){
    return this.b;
}
 
 /**
  * Since the XML file is structured in a matter that every point has 2 kids , I had to create these functions to prevent errors(spaces etc) on creating the X and Y Strings for the data in the file.
  * 
  * @return String of X value
  */
 public String toStringx(){
	 String s = ((Integer)this._x).toString();
	 return s;
 }
  
 /**
  *Since the XML file is structured in a matter that every point has 2 kids , I had to create these functions to prevent errors(spaces etc) on creating the X and Y Strings for the data in the file.
  * @return String of Y Value
  */
 public String toStringy(){
	 String s = ((Integer)this._y).toString();
	 return s;
 }
}
